home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / tcxl551.arc / TCXL_INC.EXE / lha / INC / TCXLFMT.H < prev    next >
Text File  |  1990-10-01  |  6KB  |  101 lines

  1. /*=====[ The TesSeRact(TM) CXL User Interface Development System ]======*
  2.  | Copyright (c) 1987-1990, Innovative Data Concepts. All Rights Reserved
  3.  |
  4.  | This Library is part of IDC's TesSeRact Development Tools product
  5.  | line. For information about other IDC products, call 1-215-884-3373.
  6.  *----------------------------------------------------------------------*
  7.  | <TCXLfmt.h> : Definitions and prototypes for TCXL format-string input
  8.  | functions.
  9.  *----------------------------------------------------------------------*
  10.  | PGS : $Id: tcxlfmt.h 5.51 90/10/01 00:00:00 MLM Release Locker: MLM $
  11.  | $Log:    tcxlfmt.h $
  12.  | Revision 5.51  90/10/01  00:00:00  MLM
  13.  | TCXL 5.51
  14.  | 
  15.  *======================================================================*/
  16. #ifndef  _TCXLfmt_
  17. #  define   _TCXLfmt_ 1
  18. #  ifndef   _TCXLdef_
  19. #     include  <TCXLdef.h>
  20. #  endif
  21.                            /*- format-options -----*/
  22. #define  FMT_CPY  0x01     /* 'C'  copy to output  */
  23. #define  FMT_ESC  0x02     /* 'E'  [Esc] detect    */
  24. #define  FMT_RTN  0x04     /* 'R'  [CR] detect     */
  25. #define  FMT_PAS  0x08     /* 'P'  password        */
  26. #define  FMT_LWR  0x10     /* 'L'  lower case      */
  27. #define  FMT_MIX  0x20     /* 'M'  mixed case      */
  28. #define  FMT_UPR  0x40     /* 'U'  upper case      */
  29. #define  FMT_CNV  0x70     /* 'L|M|U'  convert     */
  30. #define  FMT_END  0x80     /* end-of-format        */
  31. #define  FMT_TRM  0x84     /* end | 'R'  terminate */
  32. #define  FMT_INI  0x06     /* 'E|R'  initial       */
  33.                            /*- format-usages ------*/
  34. #define  FMT_GET  0x00     /* KvGetFmt(), etc.     */
  35. #define  FMT_WIN  0x01     /* KwGetFmt(), etc.     */
  36. #define  FMT_ENT  0x02     /* EntFld()             */
  37. #define  FMT_NUM  0x04     /*    decimal field     */
  38. #define  FMT_CUR  0x08     /*    currency field    */
  39.  
  40. /*------------------[ Data objects and access macros ]-----------------*/
  41.  
  42. TYP   struct   Fmt   FmtT;
  43. struct   Fmt            /*-[ Format-control object ]-----*/
  44. {  ChrP  ftgl;          /* 00|00 : option toggle string  */
  45.    ChrP  fchr;          /* 02|04 : control char string   */
  46.    VfiCP fput;          /* 04|08 : backspace function    */
  47.    BytT  flen;          /* 06|0C : input field length    */
  48.    BytT  fdec;          /* 07|0D : decimal position      */
  49.    BytT  fopt;          /* 08|0E : option state          */
  50.    BytT  fuse;          /* 09|0F : usage state           */
  51.    ChrT  fpfx;          /* 0A|10 : currency-prefix char  */
  52.    ChrT  fsep;          /* 0B|11 : currency-separator    */
  53.    ChrT  fsfx;          /* 0C|12 : currency-suffix char  */
  54.    BytT  ffut[3];       /* 0D|13 : reserved for future   */
  55. };                      /* 10|16 ]-----------------------*/
  56.  
  57. GBL   FmtT  CDC   _FmtCtl;    /*- Global format-control object ---------*/
  58. #define  FmtTgl   (_FmtCtl.ftgl)                /* option chars         */
  59. #define  FmtChr   (_FmtCtl.fchr)                /* control chars        */
  60. #define  FmtPut   (_FmtCtl.fput)                /* backspace function   */
  61. #define  FmtLen   (_FmtCtl.flen)                /* field length         */
  62. #define  FmtDec   (_FmtCtl.fdec)                /* decimal position     */
  63. #define  FmtOpt   (_FmtCtl.fopt)                /* option state         */
  64. #define  FmtCpy   (0 != (FmtOpt & FMT_CPY))     /*    copy to output    */
  65. #define  FmtEsc   (0 != (FmtOpt & FMT_ESC))     /*    [Esc] detect      */
  66. #define  FmtRtn   (0 != (FmtOpt & FMT_RTN))     /*    [CR] detect       */
  67. #define  FmtPas   (0 != (FmtOpt & FMT_PAS))     /*    password          */
  68. #define  FmtLwr   (0 != (FmtOpt & FMT_LWR))     /*    lower case        */
  69. #define  FmtMix   (0 != (FmtOpt & FMT_MIX))     /*    mixed case        */
  70. #define  FmtUpr   (0 != (FmtOpt & FMT_UPR))     /*    upper case        */
  71. #define  FmtCnv   (0 != (FmtOpt & FMT_CNV))     /*    convert           */
  72. #define  FmtEnd   (0 != (FmtOpt & FMT_END))     /*    end-of-format     */
  73. #define  FmtTrm   (0 != (FmtOpt & FMT_TRM))     /*    terminate         */
  74. #define  FmtUse   (_FmtCtl.fuse)                /* usage state          */
  75. #define  FmtGet   (0 != (FmtUse & FMT_GET))     /*   KvGetFmt(), etc    */
  76. #define  FmtWin   (0 != (FmtUse & FMT_WIN))     /*   KwGetFmt(), etc    */
  77. #define  FmtEnt   (0 != (FmtUse & FMT_ENT))     /*   EntFld()           */
  78. #define  FmtNum   (0 != (FmtUse & FMT_NUM))     /*      decimal         */
  79. #define  FmtCur   (0 != (FmtUse & FMT_CUR))     /*      currency        */
  80. #define  FmtPfx   (_FmtCtl.fpfx)                /* currency prefix      */
  81. #define  FmtSep   (_FmtCtl.fsep)                /* currency separator   */
  82. #define  FmtSfx   (_FmtCtl.fsfx)                /* currency suffix      */
  83.  
  84. /*------------------------[ Function prototypes ]-----------------------*/
  85.  
  86. #ifdef __cplusplus         /* no mangling, please */
  87.    extern   "C"   {
  88. #endif
  89. VOID  CTYP  FmtBack(ChrI f, ChrI o);   /* Backspace format              */
  90. IntT  CTYP  FmtChar(IntT c, IntT f);   /* Validate character            */
  91. IntT  CTYP  FmtExcl(ChrI f, IntT c);   /* Exclusion-set                 */
  92. VOID  CTYP  FmtFlip(IntT c);           /* Toggle option                 */
  93. IntT  CTYP  FmtIncl(ChrI f, IntT c);   /* Inclusion set                 */
  94. IntT  CTYP  FmtInit(ChrP f, IntT u);   /* Inititalize and verify format */
  95. VOID        FmtPutF(VfiCP f);          /* Assign backspace function     */
  96. #define  FmtPutF(f)  (FmtPut = (f))
  97. #ifdef __cplusplus
  98.    }
  99. #endif
  100. #endif   /* _TCXLfmt_ : End of TCXLfmt.h */
  101.